package com.example.resourceSharingPlatform.mappers;

import com.example.resourceSharingPlatform.entity.CDKey;
import org.springframework.jdbc.core.RowMapper;


import java.sql.ResultSet;
import java.sql.SQLException;

public class CDKeyRowMapper implements RowMapper<CDKey> {
    @Override
    public CDKey mapRow(ResultSet rs, int i)throws SQLException {
        CDKey cdKey = new CDKey();
        cdKey.setKey(rs.getString("cdk"));
        cdKey.setAmount(rs.getDouble("amount"));
        cdKey.setUsed(rs.getString("used"));
        return cdKey;
    }

}
